﻿using System;
using System.Collections.Generic;
using System.Text;
using System.CodeDom;

namespace DesignPatternToolkit.Core
{
    /// <summary>
    /// Defines the structure for pattern builder.
    /// </summary>
	public abstract class PatternBuilder
	{
        protected List<CodeTypeDeclaration> codeTypes = new List<CodeTypeDeclaration>();

        /// <summary>
        /// Gets or sets the <see cref="Configuration"/> class for this design pattern.
        /// </summary>
		public PatternConfiguration Configuration { get; set; }

        /// <summary>
        /// Creates the actual classes!
        /// </summary>
        /// <returns>
        /// Retursn a list of <see cref="CodeNamespace"/> instances, each containing just one class.
        /// We'll be using that class as the name of the file.
        /// </returns>
        public List<CodeNamespace> CreateClasses()
		{
			return CreateClassesCore();
		}

        /// <summary>
        /// When overridden in class, holds the actual code for creating code.
        /// </summary>
        protected abstract List<CodeNamespace> CreateClassesCore();
		
		/// <summary>
		/// Gets the name of the Design Pattern that this builder is building.
		/// </summary>
		public abstract string PatternName { get; }
	}
}
